import deliveryExpressApi from "@/api/declaration/mall/deliveryExpressApi"
import httpRequest from "@/config/axios/httpRequest"
import { DeliveryExpressModel } from "@/models/mall/DeliveryExpressModel"


// 查询快递公司列表
export const getDeliveryExpressPage = async (params: PageParam) => {
  return await httpRequest.get(deliveryExpressApi.GetDeliveryExpressPage, {params})
}

// 查询快递公司详情
export const getDeliveryExpress = async (id: number) => {
  return await httpRequest.get(deliveryExpressApi.GetDeliveryExpress, {params: {id}})
}

// 获得快递公司精简信息列表
export const getSimpleDeliveryExpressList = () => {
  return httpRequest.get(deliveryExpressApi.GetSimpleDeliveryExpressList)
}

// 新增快递公司
export const createDeliveryExpress = async (data: DeliveryExpressModel) => {
  return await httpRequest.post(deliveryExpressApi.CreateDeliveryExpress, data)
}

// 修改快递公司
export const updateDeliveryExpress = async (data: DeliveryExpressModel) => {
  return await httpRequest.put(deliveryExpressApi.UpdateDeliveryExpress, data)
}

// 删除快递公司
export const deleteDeliveryExpress = async (id: number) => {
  return await httpRequest.delete(deliveryExpressApi.DeleteDeliveryExpress, {params: {id}})
}

// 导出快递公司 Excel
export const exportDeliveryExpressApi = async (params) => {
  return await httpRequest.download(deliveryExpressApi.ExportDeliveryExpress, params)
}
